Hide Controls

Hide Table Control when Empty

Description

This example shows how to hide/show the Component in a page when the number of matching records for a search is zero/non-zero.

Variables
TableControl
Select a table control
Applies to
TableControl class
Code
 
/// 
/// Override the LoadData and set the visibility of the table
/// 
public override void LoadData()
{

    // Call the MyBase LoadData()
    base.LoadData();
    
    // If totalrecords is > 0 set the visibility of the table    
    this.Visible = (this.TotalRecords > 0);
}
 

Terms of Service Privacy Statement